import { pubRequire } from '@utils/public'
const base = '/activities/invitation'
/* topSearch 活动下拉列表 */
export function getAtivityList(obj, callBack, errBack) {
  return pubRequire('get', `${base}/names`, obj, callBack, errBack)
}
/* 活动列表 */
export function getSearchList(obj, callBack, errBack) {
  return pubRequire('get', `${base}`, obj, callBack, errBack)
}
/* 活动开始 */
export function activityEnable(id, obj, callBack, errBack) {
  return pubRequire('put', `${base}/${id}/enable`, obj, callBack, errBack)
}
/* 活动结束 */
export function activityDisable(id, obj, callBack, errBack) {
  return pubRequire('put', `${base}/${id}/disable`, obj, callBack, errBack)
}
/* 查看数据详情 */
export function getDataDetail(id, obj, callBack, errBack) {
  return pubRequire('get', `${base}/${id}`, obj, callBack, errBack)
}
/* 新增活动 */
export function addActivity(obj, callBack, errBack) {
  return pubRequire('post', `${base}`, obj, callBack, errBack)
}
/* 编辑活动 */
export function editActivity(id, obj, callBack, errBack) {
  return pubRequire('put', `${base}/${id}`, obj, callBack, errBack)
}
///////////////////////////////////////////////////////////////////////////////////////
const baseUrl = '/activities/recommends-reward'
// 获取邀请记录提现列表
export function getWithdrawList(params, callBack, errBack) {
  return pubRequire('get', `${baseUrl}`, params, callBack, errBack)
}
// 获取全部活动
export function getAllActivity(params, callBack, errBack) {
  return pubRequire('get', `${baseUrl}/options`, params, callBack, errBack)
}
// 获取提现记录明细
export function getWithdrawDetail({ activityId, userId }, callBack, errBack) {
  return pubRequire('get',`${baseUrl}/withdrawals/${activityId}/users/${userId}`,'',callBack,errBack)
}
// 导出邀请提现信息
export function exportData(params, callBack, errBack) {
  return pubRequire('get', `${baseUrl}/export`, params, callBack, errBack)
}
// 提现
export function setWithdraw(id, params, callBack, errBack) {
  return pubRequire('post',`${baseUrl}/withdrawals/${id}`,params,callBack,errBack)
}
/////////////////////////////////////////////////////////////////////////////
const recordBase = '/activities/recommends-record'
// 获取转介绍邀请记录
export function getwithdrawList(params, callBack, errBack) {
  return pubRequire('get', `${recordBase}`, params, callBack, errBack)
}
// 统计接口
export function getStatisticsList(id, params, callBack, errBack) {
  return pubRequire(
    'get',
    `${recordBase}/${id}/statistics`,
    '',
    callBack,
    errBack
  )
}

// 被邀请人信息详情
export function getInviteeList(params, callBack, errBack) {
  return pubRequire('get', `${recordBase}/detail`, params, callBack, errBack)
}
